<?php 
 
class OneToOne extends fpp_tdp_Model{

  function __construct($DataObjects){
    parent::__construct($DataObjects);
  }

  public function __toString(){
    /* Construyendo el Query */
    $select[] = $this->args->db_value.' as value ';
    $select[] = $this->args->db_label.' as label ';
    $one_to_one=$this->db->from($this->args->db_table)->select($select)->get();
    /* Construyendo el Array del Dropdown */
    $drop = array();
    foreach($one_to_one as $row){
      $drop[$row->value] = $row->label;
    }
     $html = $this->AjaxConstruct(form::dropdown($this->field_name,@$drop,$this->field_value));
     return $html;
  }
  
  
}

?>